Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-D bug fixes #166

Merged

Conversation

JeffinsonDarmawan
Copy link

Fixed bugs on:

  1. Negative add and remove quantity
  2. Total quantity of flowers which exceed maximum value of an integer
  3. Now Florizz accepts Baby Breath or other flowers which have more than one word in their name

@JeffinsonDarmawan JeffinsonDarmawan added type.Bug A bug priority.High Must do severity.Medium Bugs that causes occasional inconvenience but users can still use the product labels Apr 11, 2024
@JeffinsonDarmawan JeffinsonDarmawan added this to the v2.1 milestone Apr 11, 2024
@JeffinsonDarmawan JeffinsonDarmawan self-assigned this Apr 11, 2024
Comment on lines +73 to +76
int newQuantity = currentQuantity + quantity;
if ((quantity > 0 && currentQuantity > Integer.MAX_VALUE - quantity) || newQuantity < 0) {
throw new FlorizzException("You have added too much flowers!");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catching of large value exceptions!

@JeffinsonDarmawan JeffinsonDarmawan merged commit 3ba51d6 into AY2324S2-CS2113-T11-3:master Apr 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do severity.Medium Bugs that causes occasional inconvenience but users can still use the product type.Bug A bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants